var baseUrl = 'https://api.tf2sc.cn/';
// 通用的请求函数
function requst(path, data) {
    return new Promise((resolve) => {
        uni.request({
            url: path,
            data,
			header:{
				"PlatformType":"h5",
			},
            success: (res) => {
                resolve(res);
            }
        });
    });
}
const baoma = data =>requst(baseUrl + "api/tfcar/car/convenient",data)
const second = data => requst(baseUrl + "api/tfcar/car/list",data)
const xin = data => requst(baseUrl + "api/tfcar/newCar/list")
const news = data => requst(baseUrl + "api/tfcar/website/allNews",data)
const er = data => requst(baseUrl + "api/tfcar/car/list",data)
// 二手车页品牌
const userCarBrand = data => requst(baseUrl + 'api/tfcar/car/brand300')

// 二手车页价格
const userCarPirce = data => requst(baseUrl + 'api/tfcar/car/price')

// 二手车页车型
const userCarModel = data => requst(baseUrl + 'api/tfcar/car/model')
// 新车页列表
const newCarList = data => requst(baseUrl + 'api/tfcar/newCar/list')
export {
	baoma,
	second,
	xin,
	news,
	er,
	userCarBrand,
	userCarPirce,
	userCarModel,
	newCarList
}